import { Local } from './storage';

const TOKEN_KEY = 'token';

const isLogin = () => {
  // return !!localStorage.getItem(TOKEN_KEY);
  return !!Local.get(TOKEN_KEY);
};

const getToken = () => {
  // return localStorage.getItem(TOKEN_KEY);
  return Local.get(TOKEN_KEY);
};

const setToken = (token: string) => {
  // localStorage.setItem(TOKEN_KEY, token);
  return Local.set(TOKEN_KEY, token);
}

const clearToken = () => {
  // localStorage.removeItem(TOKEN_KEY);
  return Local.remove(TOKEN_KEY);
};

export { isLogin, getToken, setToken, clearToken };
